class CreateLogVisitHistories < ActiveRecord::Migration[5.1]
  def change
    create_table :log_visit_histories do |t|
      t.integer :user_id, comment: '对应用户'
      t.string :controller, comment: 'controller'
      t.string :action, comment: 'action'
      t.string :method_type, comment: 'post/get/put/path'
      t.string :id_param, comment: 'id'
      t.string :ip, comment: 'ip'

      t.timestamps
    end

    add_index :log_visit_histories, :user_id
    add_index :log_visit_histories, :ip
  end
end
